There are those who believe that the GUID is the greatest innovation in information technology since twos-compliment, using them to identify everything from cars to invoices to llama. Then there are those who have to work with and maintain systems built by the wish-I-chould-change-my-name-to-a-GUID type. Perry Pederson falls in the later camp and gets to work with code like this ...

public static int GetOrderIdFromServicesOrderId(Guid orderId)
{
  byte[] ba = orderId.ToByteArray();
  return ba[0] + (ba[1] << 8) + (ba[2] << 16) + (ba[3] << 24);
}

public static Guid GetServicesOrderIdFromOrderId(int OrderId)
{
  return new Guid(OrderId, 0,0,0,0,0,0,0,0,0,0);
}

[Advertisement] BuildMaster allows you to create a self-service release management platform that allows different teams to manage their applications. Explore how!